<template>
  <div>
    <div class="banlance_header">
      <p class="banlance_title">账户余额（元）</p>
      <p class="banlance_number">{{banlanceInfo.moneynum}}</p>
      <button class="banlance_record" @click="recordClick">提现记录</button>
    </div>
    <div class="banlance_btn">
      <x-button type="primary" class="buy-card" link="/home/buyCard">购买房卡</x-button>
      <agent-button class="draw-cash" @btnClick="drawClick">提现</agent-button>
    </div>
  </div>
</template>
<script>
import { XButton } from "vux";
import AgentButton from "../../../components/common/AgentButton.vue";
export default {
  data() {
    return {
      banlanceInfo: {}
    };
  },
  components: {
    XButton,
    AgentButton
  },
  created() {
    this.apiService.user.withdrawals().then(res => {
      this.banlanceInfo = res.data;
    });
  },
  methods: {
    drawClick() {
      // let beginTime = this.banlanceInfo.
      this.$router.push({
        path: "withdrawals",
        query: {
          limitInfo: JSON.stringify(this.banlanceInfo)
        }
      });
    },
    recordClick() {
      this.$router.push("withdrawRecord");
    }
  }
};
</script>
<style scoped>
.banlance_header {
  background-color: #1b82d2;
  padding-left: 0.35rem;
  position: relative;
}
.banlance_title {
  color: #d7e9f7;
  font-size: 0.35rem;
  padding-top: 0.4rem;
}
.banlance_number {
  color: #fff;
  font-size: 1rem;
  margin-top: 0.45rem;
  padding-bottom: 0.45rem;
}
.banlance_record {
  position: absolute;
  right: 0.15rem;
  top: 0.36rem;
  border: 0.02rem solid #d7e9f7;
  border-radius: 0.1rem;
  color: #fff;
  padding: 0.07rem 0.25rem;
}
.banlance_btn {
  padding: 0 0.3rem;
}
.buy-card,
.draw-cash {
  height: 0.8rem;
}
.buy-card {
  margin-top: 0.75rem;
}
.draw-cash {
  background-color: #1b82d2;
  margin-top: 0.4rem;
  width: 100%;
}
</style>

